package com.hqd.ch03.v16.aop.framework.aspectj;

import com.hqd.ch03.v16.aop.AfterReturningAdvice;
import com.hqd.ch03.v16.aop.framework.AfterAdvice;

import javax.annotation.Nullable;
import java.lang.reflect.Method;

public class AspectJAfterReturningAdvice extends AbstractAspectJAdvice implements AfterReturningAdvice, AfterAdvice {
    public AspectJAfterReturningAdvice(AspectJExpressionPointcut pointcut, Method aspectJAdviceMethod, Object aspect) {
        super(pointcut, aspectJAdviceMethod, aspect);
    }

    @Override
    public void afterReturning(@Nullable Object returnValue, Method method, Object[] args, @Nullable Object target) throws Throwable {
        invokeAdviceMethod(method);
    }
}
